import Vue from 'vue'
import App from './App.vue'
import router from './router'
// 导入全局样式
import './assets/css/global.css'
// 导入字体样式
import './assets/fonts/iconfont.css'
import axios from 'axios'
// 按需导入插件
import {
  Form,
  Input,
  Button,
  FormItem,
  Container,
  Main,
  Aside,
  Header,
  Card,
  BreadcrumbItem,
  Breadcrumb,
  Menu,
  Submenu,
  MenuItem,
  MenuItemGroup,
  Table,
  TableColumn,
  Pagination,
  Select,
  Option
} from 'element-ui'
// 通过自定义配置来创建axios
axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1'
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
  return config
}, function (error) {
  return Promise.reject(error)
})
Vue.prototype.$http = axios
Vue.use(Form)
Vue.use(Input)
Vue.use(Button)
Vue.use(FormItem)
Vue.use(Container)
Vue.use(Main)
Vue.use(Aside)
Vue.use(Header)
Vue.use(Card)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
Vue.use(Menu)
Vue.use(Submenu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Table)
Vue.use(TableColumn)
Vue.use(Pagination)
Vue.use(Select)
Vue.use(Option)
Vue.config.productionTip = false

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
